CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

SET( PROJECT_NAME_TEMP "DisholLib" )

INCLUDE( FindDirectShow.cmake )

#MESSAGE("DirectShow:")
#MESSAGE("Found:	${DIRECTSHOW_FOUND}")
#MESSAGE("Include: ${DirectShow_INCLUDE_DIR}")
#MESSAGE("Libs: ${DirectShow_LIBRARY}")


IF( DIRECTSHOW_FOUND )

	PROJECT( ${PROJECT_NAME_TEMP} )

	# Set some Microsoft compiler specific options 
	IF( MSVC )
		# Set Unicode as character set for Visual Studio projects. By default it's Multi-Byte
		ADD_DEFINITIONS(-DUNICODE -D_UNICODE)
			
		# Set Warning level to 4
		IF ( CMAKE_CXX_FLAGS MATCHES "/W[0-4]" )
			STRING( REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
		ELSE()
			SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" )
		ENDIF()
	ENDIF()

	SET	(	SOURCES
			qedit.h

			DisholCOMObjectSharedPtr.h
			DisholCOMObjectSharedPtr.cpp
			DisholCriticalSectionEnterer.h
			DisholCriticalSectionEnterer.cpp		
			DisholUnicode.h
			DisholUnicode.cpp

			DisholMemoryBuffer.h
			DisholMemoryBuffer.cpp
			DisholImageFormat.h
			DisholImageFormat.cpp
			DisholImage.h
			DisholImage.cpp
			DisholImageConverter.h
			DisholImageConverter.cpp
		
			DisholCaptureSettings.h
			DisholCaptureSettings.cpp
			DisholCapturedImage.h
			DisholCapturedImage.cpp
			DisholDeviceInternals.h
			DisholDeviceInternals.cpp
			DisholDevice.h
			DisholDevice.cpp
			DisholDeviceManager.h
			DisholDeviceManager.cpp		
		)	
	
	ADD_LIBRARY( ${PROJECT_NAME} STATIC ${SOURCES} )

	TARGET_LINK_LIBRARIES(	${PROJECT_NAME} ${DirectShow_LIBRARY} )

ELSE()

	MESSAGE("Can't find DirectShow library. Project ${PROJECT_NAME_TEMP} won't be compiled")

ENDIF()




 
 